#ifndef CHARACTEREDITFORM_H
#define CHARACTEREDITFORM_H

#include "EditFormWrapper.h"

#include <D20CharacterModel.h>
#include <D20CampaignModel.h>

#include <QWidget>

namespace Ui {
    class CharacterEditForm;
}

class CharacterEditFormBase : public QWidget, public AbstractEditFormActions
{
    Q_OBJECT

public:

    virtual void updateData();


protected:

    CharacterEditFormBase(QWidget *parent = 0);
    ~CharacterEditFormBase();

    virtual D20BaseModel* model() const;


protected:

    void openCampaign(const QString& file_path);


protected slots:

    virtual void initialize();
    virtual void onActionTriggered(QAction* action);

    void onUpdateCampaigns();

private:

    Ui::CharacterEditForm *ui;
    D20CharacterModel* m_character;
    D20CampaignModel* m_campaign;


private slots:

    void on_actionDelete_triggered();
    void on_lineEditName_editingFinished();
    void on_comboBoxCampaign_currentIndexChanged(int index);
    void on_pushButtonOpenCampaign_clicked();
};


typedef EditFormWrapper<CharacterEditFormBase> CharacterEditForm;



#endif // CHARACTEREDITFORM_H
